// 试验箱监控网格配置
import AbilityList from './deviceAbility.js'
// 重要
const importancePriority = 'importance'
// 一般
const ordinaryPriority = 'ordinary'
const gridBlueColor = '#5b76ff'

const testState = {
  propertyName: '试验状态',
  dataName: 'testState',
  priority: importancePriority,
  color: gridBlueColor
}
const testType = {
  propertyName: '试验类型',
  dataName: 'testType',
  priority: importancePriority
}
const curProRunDuration = {
  propertyName: '运行时间',
  dataName: 'curProRunDuration',
  priority: ordinaryPriority
}
const programRunTime = {
  propertyName: '程序运行时间',
  dataName: 'programRunTime',
  priority: ordinaryPriority
}
const constantRunTime = {
  propertyName: '定值运行时间',
  dataName: 'constantRunTime',
  priority: ordinaryPriority
}
const programRemainTime = {
  propertyName: '程序剩余时间',
  dataName: 'programRemainTime',
  priority: ordinaryPriority
}
const constantRemainTime = {
  propertyName: '定值剩余时间',
  dataName: 'constantRemainTime',
  priority: ordinaryPriority
}
const curProCurStepRemainTime = {
  propertyName: '当前段剩余时间',
  dataName: 'curProCurStepRemainTime',
  priority: ordinaryPriority
}
const endOfReservation = {
  propertyName: '结束预定',
  dataName: 'endOfReservation',
  priority: ordinaryPriority
}
const endMode = {
  propertyName: '结束方式',
  dataName: 'endMode',
  priority: ordinaryPriority
}
const heaterMsg = {
  propertyName: '加热器输出',
  dataName: 'heaterMsg',
  priority: ordinaryPriority
}
const curProId = {
  propertyName: '程序号',
  dataName: 'curProId',
  priority: ordinaryPriority
}
const curProCurStep = {
  propertyName: '当前段号',
  dataName: 'curProCurStep',
  priority: ordinaryPriority
}
const programCurStep = {
  propertyName: '当前段号',
  dataName: 'programCurStep',
  priority: ordinaryPriority
}
const period = {
  propertyName: '周期',
  dataName: 'period',
  priority: ordinaryPriority
}
const curCircleCount = {
  propertyName: '当前循环',
  dataName: 'curCircleCount',
  priority: ordinaryPriority
}
const curCircleStep = {
  propertyName: '循环段号',
  dataName: 'curCircleStep',
  priority: ordinaryPriority
}
const curTotalCircleCount = {
  propertyName: '循环次数',
  dataName: 'curTotalCircleCount',
  priority: ordinaryPriority
}
const programCurStepRemainTime = {
  propertyName: '当前段剩余时间',
  dataName: 'programCurStepRemainTime',
  priority: ordinaryPriority
}
const programEndMode = {
  propertyName: '结束方式',
  dataName: 'programEndMode',
  priority: ordinaryPriority
}
const programId = {
  propertyName: '程序号',
  dataName: 'programId',
  priority: ordinaryPriority
}
const programName = {
  propertyName: '程序名称',
  dataName: 'programName',
  priority: ordinaryPriority
}
const damper = {
  propertyName: '风门开度',
  dataName: 'damper',
  priority: ordinaryPriority
}
const testCycleNum = {
  propertyName: '试验循环数',
  dataName: 'testCycleNum',
  priority: ordinaryPriority
}

const defrostCycleNum = {
  propertyName: '除霜循环数',
  dataName: 'defrostCycleNum',
  priority: ordinaryPriority
}

const box1C01ProgramGridList = [testState, programCurStepRemainTime, programEndMode, programId]
setBoxAbilityList(AbilityList.box1C01AbilityList, box1C01ProgramGridList)
const box1C01ConstantGridList = [testState]
setBoxAbilityList(AbilityList.box1C01AbilityList, box1C01ConstantGridList)

const box1D01ProgramGridList = [testState, programCurStepRemainTime, programEndMode, programId]
setBoxAbilityList(AbilityList.box1D01AbilityList.concat(damper), box1D01ProgramGridList)
const box1D01ConstantGridList = [testState]
setBoxAbilityList(AbilityList.box1D01AbilityList.concat(damper), box1D01ConstantGridList)

const box1E01ProgramGridList = [testState, programCurStepRemainTime, programEndMode, programId, programName]
setBoxAbilityList(AbilityList.box1E01AbilityList, box1E01ProgramGridList)
const box1E01ConstantGridList = [testState]
setBoxAbilityList(AbilityList.box1E01AbilityList, box1E01ConstantGridList)

const box1H01ProgramGridList = [testState, programCurStepRemainTime, programEndMode, programId, programName]
setBoxAbilityList(AbilityList.box1H01AbilityList, box1H01ProgramGridList)
const box1H01ConstantGridList = box1C01ConstantGridList

const box1I01ProgramGridList = box1E01ProgramGridList
const box1I01ConstantGridList = box1E01ConstantGridList

const box1K01ProgramGridList = [testState, programCurStepRemainTime, programEndMode, programId]
setBoxAbilityList(AbilityList.box1K01AbilityList, box1K01ProgramGridList)
const box1K01ConstantGridList = [testState]
setBoxAbilityList(AbilityList.box1K01AbilityList, box1K01ConstantGridList)

const box1F01ProgramGridList = [
  testState,
  programCurStepRemainTime,
  programEndMode,
  programId,
  programName,
  testCycleNum,
  defrostCycleNum
]
setBoxAbilityList(AbilityList.box1F01AbilityList, box1F01ProgramGridList)

const box1G01ProgramGridList = box1F01ProgramGridList

const box1J01ProgramGridList = box1G01ProgramGridList

function setBoxAbilityList(boxAbilityList, gridList) {
  for (const item of boxAbilityList) {
    const data = JSON.parse(JSON.stringify(item))
    data['priority'] = importancePriority
    data['color'] ? '' : (data['color'] = gridBlueColor)
    gridList.push(data)
  }
}
export default {
  box1C01ProgramGridList,
  box1C01ConstantGridList,
  box1D01ProgramGridList,
  box1D01ConstantGridList,
  box1E01ProgramGridList,
  box1E01ConstantGridList,
  box1F01ProgramGridList,
  box1G01ProgramGridList,
  box1H01ProgramGridList,
  box1H01ConstantGridList,
  box1I01ProgramGridList,
  box1I01ConstantGridList,
  box1J01ProgramGridList,
  box1K01ProgramGridList,
  box1K01ConstantGridList
}
